package com.example.controller;

import com.example.transport.ServerTransportService;
import com.exmaple.dto.RpcPing;
import com.exmaple.dto.RpcResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RequestMapping("/api/")
@RestController
public class JobAdminController {

    Logger logger = LoggerFactory.getLogger(getClass());

    @Resource
    private ServerTransportService serverTransportService;

    @PostMapping("ping")
    public RpcResponse ping(@RequestBody RpcPing rpcPing) {
        return this.serverTransportService.handler(rpcPing);
    }
}
